<template>
  <div class="search">
    <i class="iconfont icon-search" />
    <input type="text" v-model="inputValue" :placeholder="placeholder" />
  </div>
</template>

<script>
export default {
  props: {
    value: {
      type: [Number, String],
      require: true,
    },
    placeholder: {
      type: [Number, String],
      require: true,
    },
  },
  data() {
    return {
      inputValue: this.value,
    };
  },
  methods: {
    inputHandler(e) {
      const val = e.target.value;
      this.inputValue = val;
      this.$emit("input", val);
      this.$emit("change", val);
    },
  },
};
</script>

<style lang="scss" scoped>
.search {
  width: 100%;
  height: 56px;
  padding: 0 20px;

  display: flex;
  align-items: center;
  border: 3px solid var(--border-color);
  border-radius: 20px;
  box-sizing: border-box;

  .iconfont {
    font-size: 28px;
    color: var(--color);
  }

  input {
    width: 100%;
    background: none;
    border: none;
    outline: none;

    color: var(--color);
    font-size: 18px;
    font-family: "Roboto Regular";
    text-indent: 15px;
  }
}
</style>
